﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CRM.Admin.Contracts.Model.Customer;
using KingsSharp.Core.Data.Entity;

namespace CRM.Admin.Services.EntityConfigurations.Customer
{
    public class PurchaseCfg : EntityConfigurationBase<Purchase,Guid>
    {
        public PurchaseCfg()
        {
            Property(t => t.BreedName).HasMaxLength(200);
            Property(t => t.Year).HasMaxLength(80);
            Property(t => t.SupplierName).HasMaxLength(80);
            Property(t => t.MaterialMade).HasMaxLength(200);
            Property(t => t.Weight).HasPrecision(18, 2);
            HasRequired(t => t.Customer).WithMany().HasForeignKey(f => f.CustomerId);
        }
    }
}
